package test.controllers;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.code.lightsomy.annotations.Action;
import com.google.code.lightsomy.annotations.AfterAction;
import com.google.code.lightsomy.annotations.BeforeAction;
import com.google.code.lightsomy.annotations.Controller;

@Controller
public class DiscoStuff {

	@BeforeAction
	public void before(HttpServletRequest req, HttpServletResponse res) throws IOException {
		res.getWriter().append("ooo-").flush();
	}
	
	@Action(route="^/disco/action$")
	public void action(HttpServletRequest req, HttpServletResponse res) throws IOException {
		res.getWriter().append("OOO").flush();
	}
	
	@AfterAction
	public void after(HttpServletRequest req, HttpServletResponse res) throws IOException {
		res.getWriter().append("-ooo").flush();
	}
}
